Convenience methods for toString on QStringRef were added to Qt 4 years
authorrobertlipe <robertlipe@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Mon, 7 Apr 2014 03:18:36 +0000 (03:18 +0000)
committerrobertlipe <robertlipe@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Mon, 7 Apr 2014 03:18:36 +0000 (03:18 +0000)
ago.

git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@4797 f51c46e8-681c-474f-0cfe-069cfd0219fb

gpsbabel/jeeps/gpscom.cc
gpsbabel/mapfactor.cc

index cce09539a36d9cf6b4c13c3acc918daa8f8baf1a..8caa2f1a1c186ec36aedee46e8ae295c054e1308 100644 (file)
@@ -1190,6 +1190,7 @@ int32 GPS_Command_Send_Track_As_Course(const char* port, GPS_PTrack* trk, int32
     crs = (struct GPS_SCourse**)xrealloc(crs, (n_crs+1) * sizeof(GPS_PCourse));
     crs[n_crs] = GPS_Course_New();
     if (!crs[n_crs]) {
+      if (clp) xfree(clp);
       return MEMORY_ERROR;
     }
 
@@ -1203,6 +1204,7 @@ int32 GPS_Command_Send_Track_As_Course(const char* port, GPS_PTrack* trk, int32
     clp = (struct GPS_SCourse_Lap**) xrealloc(clp, (n_clp+1) * sizeof(GPS_PCourse_Lap));
     clp[n_clp] = GPS_Course_Lap_New();
     if (!clp[n_clp]) {
+      if (clp) xfree(clp);
       return MEMORY_ERROR;
     }
 
@@ -1223,6 +1225,7 @@ int32 GPS_Command_Send_Track_As_Course(const char* port, GPS_PTrack* trk, int32
 
     ctk[n_ctk] = GPS_Track_New();
     if (!ctk[n_ctk]) {
+      if (clp) xfree(clp);
       return MEMORY_ERROR;
     }
     *ctk[n_ctk] = *trk[i];
index 4b5983dcc5bce12edc5301d1842ad61905562ee2..3d0912c1047e820d8bca256990c4bdbee0c980ae 100644 (file)
@@ -54,8 +54,8 @@ void MapfactorRead()
 
         QXmlStreamAttributes a = reader.attributes();
         wpt->shortname = a.value("name").toString();
-        wpt->latitude = a.value("lat").toDouble() / milliarcseconds;
-        wpt->longitude = a.value("lon").toDouble() / milliarcseconds;
+        wpt->latitude = a.value("lat").toString().toDouble() / milliarcseconds;
+        wpt->longitude = a.value("lon").toString().toDouble() / milliarcseconds;
       }
     }